package cn.tuling.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Component
public class OrderService {

    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private OrderService orderService;

    @Transactional
    public void test() {
        jdbcTemplate.execute("insert into a_table values(1,1,1);");
        orderService.a();
    }

    @Transactional(propagation = Propagation.NEVER)
    public void a() {

    }
}
